package com.robot.dao.vo;

import com.alibaba.fastjson.JSONObject;
import lombok.*;

import java.io.Serializable;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BigModelVO implements Serializable {
    private ActionUnitOverViewVO actionUnit;

    public void setRobotDetail(BasicInfoVO basicInfoVO) {
        this.actionUnit.setDetail(basicInfoVO);
    }

    @Setter
    @Getter
    static class MakeEchartDetail implements Serializable{
        private Integer bigModelType;
        private String bigModelName;
        private String echartTypeDesc;
    }

    public void setMakeEchartDetail(String makeEchartDetail){
        JSONObject jsonObject = JSONObject.parseObject(makeEchartDetail, JSONObject.class);
        MakeEchartDetail makeEchartDetail1 = new MakeEchartDetail();
        makeEchartDetail1.setBigModelType(jsonObject.getInteger("bigModelType"));
        makeEchartDetail1.setBigModelName(jsonObject.getString("bigModelName"));
        makeEchartDetail1.setEchartTypeDesc(jsonObject.getString("echartTypeDesc"));
        this.actionUnit.setDetail(makeEchartDetail1);
    }

    @Setter
    @Getter
    static class TextChatDetail implements Serializable{
        private Integer bigModelType;
        private String bigModelName;
        private String characterSetting;
        private String toneSetting;
    }

    public void setTextChatDetail(String textChatDetail) {
        JSONObject jsonObject = JSONObject.parseObject(textChatDetail, JSONObject.class);
        TextChatDetail textChatDetail1 = new TextChatDetail();
        textChatDetail1.setBigModelType(jsonObject.getInteger("bigModelType"));
        textChatDetail1.setBigModelName(jsonObject.getString("bigModelName"));
        textChatDetail1.setCharacterSetting(jsonObject.getString("characterSetting"));
        textChatDetail1.setToneSetting(jsonObject.getString("toneSetting"));
        this.actionUnit.setDetail(textChatDetail1);
    }

    @Setter
    @Getter
    static class MakePictureDetail implements Serializable{
        private Integer bigModelType;
        private String bigModelName;
        private String styleSetting;
    }

    public void setMakePictureDetail(String makePictureDetail) {
        JSONObject jsonObject = JSONObject.parseObject(makePictureDetail, JSONObject.class);
        MakePictureDetail makePictureDetail1 = new MakePictureDetail();
        makePictureDetail1.setBigModelType(jsonObject.getInteger("bigModelType"));
        makePictureDetail1.setBigModelName(jsonObject.getString("bigModelName"));
        makePictureDetail1.setStyleSetting(jsonObject.getString("styleSetting"));
        this.actionUnit.setDetail(makePictureDetail1);
    }
}


